EpiCompare compares epigenetic datasets for quality control and benchmarking purposes. The report consists of three sections:

  1. General Metrics: Metrics on peaks (percentage of blacklisted and non-standard peaks, and peak widths) and fragments (duplication rate) of samples.
  2. Peak Overlap: Percetnage and statistical significance of overlapping and non-overlapping peaks. Also includes upset plot.
  3. Functional Annotation: Functional annotation (ChromHMM, ChIPseeker and enrichment analysis) of peaks. Also includes peak enrichment around TSS.

Input Datasets
  • Reference peakfile: H3K4me3_H9_E2_IR12
  • Total of 29 peak files:
## [1] "File1: H3K4me3_K562_E1_IRpseudo12"
## [1] "File2: H3K4me3_K562_E1_IRpseudo1"
## [1] "File3: H3K4me3_K562_E1_IRpseudo2"
## [1] "File4: H3K4me3_K562_E1_IR12"
## [1] "File5: H3K4me3_K562_E2_IRpseudo12"
## [1] "File6: H3K4me3_K562_E2_IRpseudo1"
## [1] "File7: H3K4me3_K562_E2_IRpseudo2"
## [1] "File8: H3K4me3_K562_E2_IR12"
## [1] "File9: H3K4me3_K562_E3_IRpseudo12"
## [1] "File10: H3K4me3_K562_E3_IRpseudo1"
## [1] "File11: H3K4me3_K562_E3_IRpseudo2"
## [1] "File12: H3K4me3_K562_E3_IR12"
## [1] "File13: H3K4me3_A549_E1_IRpseudo123"
## [1] "File14: H3K4me3_A549_E1_IRpseudo1"
## [1] "File15: H3K4me3_A549_E1_IRpseudo2"
## [1] "File16: H3K4me3_A549_E1_IRpseudo3"
## [1] "File17: H3K4me3_A549_E1_IR123"
## [1] "File18: H3K4me3_A549_E2_IRpseudo12"
## [1] "File19: H3K4me3_A549_E2_IRpseudo1"
## [1] "File20: H3K4me3_A549_E2_IRpseudo2"
## [1] "File21: H3K4me3_A549_E2_IR12"
## [1] "File22: H3K4me3_H9_E1_MINT_IRpseudo12"
## [1] "File23: H3K4me3_H9_E1_MINT_IRpseudo1"
## [1] "File24: H3K4me3_H9_E1_MINT_IRpseudo2"
## [1] "File25: H3K4me3_H9_E1_MINT_IR12"
## [1] "File26: H3K4me3_H9_E2_IRpseudo12"
## [1] "File27: H3K4me3_H9_E2_IRpseudo1"
## [1] "File28: H3K4me3_H9_E2_IRpseudo2"
## [1] "File29: H3K4me3_H9_E2_IR12"
Code
EpiCompare(peakfiles = list(H3K4me3_K562_E1_IRpseudo12, H3K4me3_K562_E1_IRpseudo1, H3K4me3_K562_E1_IRpseudo2, H3K4me3_K562_E1_IR12, H3K4me3_K562_E2_IRpseudo12, H3K4me3_K562_E2_IRpseudo1, H3K4me3_K562_E2_IRpseudo2, H3K4me3_K562_E2_IR12, H3K4me3_K562_E3_IRpseudo12, H3K4me3_K562_E3_IRpseudo1, H3K4me3_K562_E3_IRpseudo2, H3K4me3_K562_E3_IR12, H3K4me3_A549_E1_IRpseudo123, H3K4me3_A549_E1_IRpseudo1, H3K4me3_A549_E1_IRpseudo2, H3K4me3_A549_E1_IRpseudo3, H3K4me3_A549_E1_IR123, H3K4me3_A549_E2_IRpseudo12, H3K4me3_A549_E2_IRpseudo1, H3K4me3_A549_E2_IRpseudo2, H3K4me3_A549_E2_IR12, H3K4me3_H9_E1_MINT_IRpseudo12, H3K4me3_H9_E1_MINT_IRpseudo1, H3K4me3_H9_E1_MINT_IRpseudo2, H3K4me3_H9_E1_MINT_IR12, H3K4me3_H9_E2_IRpseudo12, H3K4me3_H9_E2_IRpseudo1, H3K4me3_H9_E2_IRpseudo2, H3K4me3_H9_E2_IR12),
           genome_build = hg38,
           blacklist = blacklist,
           picard_files = list(),
           reference = H3K4me3_H9_E2_IR12,
           stat_plot = FALSE,
           chromHMM_plot = FALSE,
           chromHMM_annotation = "K562",
           chipseeker_plot = FALSE,
           enrichment_plot = FALSE,
           interact = TRUE,
           save_output = TRUE,
           output_dir = "/Users/xindong/Downloads/H3K4me3")

1. General Metrics

Peak Information

Column Description:

  • PeakN before tidy: Total number of peaks including those blacklisted and those in non-standard chromosomes.
  • Blacklisted peaks removed (%): Percentage of blacklisted peaks in samples. E.g. ENCODE hg19 blacklist includes regions in the hg19 genome that have anomalous and/or unstructured signals independent of the cell-line or experiment.
  • Non-standard peaks removed (%): Percentage of peaks in non-standard and/or mitochondrial chromosomes. Identified using BRGenomics::tidyChromosomes().
  • PeakN after tidy: Total number of peaks after removing those in blacklisted regions and non-standard chromosomes.

NB: EpiCompare uses filtered peakfiles (i.e. datasets after removing peaks in blacklisted regions and non-standard chromosomes)


Sample PeakN before tidy Blacklisted peaks removed (%) Non-standard peaks removed (%) PeakN after tidy
H3K4me3_K562_E1_IRpseudo12 21146 0 0 21146
H3K4me3_K562_E1_IRpseudo1 19324 0 0 19324
H3K4me3_K562_E1_IRpseudo2 20493 0 0 20493
H3K4me3_K562_E1_IR12 19707 0 0 19707
H3K4me3_K562_E2_IRpseudo12 23132 0 0 23132
H3K4me3_K562_E2_IRpseudo1 22558 0 0 22558
H3K4me3_K562_E2_IRpseudo2 22315 0 0 22315
H3K4me3_K562_E2_IR12 21743 0 0 21743
H3K4me3_K562_E3_IRpseudo12 29544 0 0 29544
H3K4me3_K562_E3_IRpseudo1 26395 0 0 26395
H3K4me3_K562_E3_IRpseudo2 25916 0 0 25916
H3K4me3_K562_E3_IR12 29697 0 0 29697
H3K4me3_A549_E1_IRpseudo123 27884 0 0 27884
H3K4me3_A549_E1_IRpseudo1 27859 0 0 27859
H3K4me3_A549_E1_IRpseudo2 21245 0 0 21245
H3K4me3_A549_E1_IRpseudo3 22513 0 0 22513
H3K4me3_A549_E1_IR123 25634 0 0 25634
H3K4me3_A549_E2_IRpseudo12 32532 0 0 32532
H3K4me3_A549_E2_IRpseudo1 32147 0 0 32147
H3K4me3_A549_E2_IRpseudo2 27803 0 0 27803
H3K4me3_A549_E2_IR12 32426 0 0 32426
H3K4me3_H9_E1_MINT_IRpseudo12 48556 0 0 48556
H3K4me3_H9_E1_MINT_IRpseudo1 44655 0 0 44655
H3K4me3_H9_E1_MINT_IRpseudo2 53066 0 0 53066
H3K4me3_H9_E1_MINT_IR12 44433 0 0 44433
H3K4me3_H9_E2_IRpseudo12 46229 0 0 46229
H3K4me3_H9_E2_IRpseudo1 30514 0 0 30514
H3K4me3_H9_E2_IRpseudo2 65983 0 0 65983

Fragment Information

Metrics on fragments is shown only if Picard summary is provided. See manual for help.

Column Description:

  • Mapped_Fragments: Number of mapped read pairs in the file.
  • Duplication_Rate: Percentage of mapped sequence that is marked as duplicate.
  • Unique_Fragments: Number of mapped sequence that is not marked as duplicate.


|| || || ||


Peak widths

Distribution of peak widths in samples



2. Peak Overlap

Percentage Overlap

Percentage of overlapping peaks between samples. Hover over heatmap for percentage values.

N.B. How to interpret heatmap: [Samples in x-axis of heatmap] peaks in [Samples in y-axis of heatmap] peaks



Upset Plot

Upset plot of overlapping peaks between samples. See here on how to interpret the plot.


Statistical Significance

Depending on the format of the reference file, EpiCompare outputs different plots:

  • Reference dataset has BED6+4 format (peakcalling performed with MACS2): EpiCompare generates paired boxplot per sample showing the distribution of -log10(q-value) of reference peaks that are overlapping and non-overlapping with the sample dataset.
  • Reference dataset does not have BED6+4 format: EpiCompare generates a barplot of percentage of overlapping sample peaks with the reference, coloured by statistical significance (adjusted p-value) of the overlap.

Reference peakfile: H3K4me3_H9_E2_IR12

Keys:

  • Overlap: Sample peaks in Reference peaks
  • Unique: Sample peaks not in Reference peaks



3. Functional Annotation

3.1 ChromHMM

ChromHMM annotates and characterises peaks into different chromatin states. ChromHMM annotations used in EpiCompare were obtained from here.

  • Cell-type annotation file used in this analysis: K562

All samples

ChromHMM annotation of individual samples.

[1] “No plot”

Overlap: Sample peaks in Reference peaks

Percentage of Sample peaks found in Reference peaks (Reference peakfile: H3K4me3_H9_E2_IR12)

ChromHMM annotation of sample peaks found in reference peaks.

Overlap: Reference peaks in Sample peaks

Percentage of Reference peaks found in Sample peaks (Reference peakfile: H3K4me3_H9_E2_IR12)

ChromHMM annotation of reference peaks found in sample peaks.

Unique: Sample peaks not in Reference peaks

Percentage of sample peaks not found in reference peaks (Reference peakfile: H3K4me3_H9_E2_IR12)

ChromHMM annotation of sample peaks not found in reference peaks.

Unique: Reference peaks not in Sample peaks

Percentage of reference peaks not found in sample peaks (Reference peakfile: H3K4me3_H9_E2_IR12)

ChromHMM annotation of reference peaks not found in sample peaks.


3.2 ChIPseeker

EpiCompare uses ChIPseeker::annotatePeak() to annotate peaks with the nearest gene and genomic regions where the peak is located. The peaks are annotated with genes taken from human genome annotations (hg19 or hg38) provided by Bioconductor.


3.3 Functional Enrichment Analysis

EpiCompare performs KEGG pathway and GO enrichment analysis using clusterProfiler. ChIPseeker::annotatePeak() is first used to assign peaks to nearest genes. Biological themes amongst the genes are identified using ontologies (KEGG and GO). The peaks are annotated with genes taken from annotations of human genome (hg19 or hg38) provided by Bioconductor.


KEGG


GO


3.4 Peak Frequency around TSS

This plots peaks that are mapping to transcriptional start sites (TSS). TSS regions are defined as the flanking sequence of the TSS sites. The frequency of peaks in downstream (-3000bp) and upstream (+3000bp) of TSS is plotted. Faint color line around the main frequency line represents the 95% confidence interval estimated by bootstrap method.

## [1] FALSE

4. Session Info

## R version 4.2.1 (2022-06-23)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Monterey 12.4
## 
## Matrix products: default
## LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] EpiCompare_1.0.0
## 
## loaded via a namespace (and not attached):
##   [1] utf8_1.2.2                               tidyselect_1.1.2                         htmlwidgets_1.5.4                       
##   [4] RSQLite_2.2.14                           AnnotationDbi_1.58.0                     grid_4.2.1                              
##   [7] BiocParallel_1.30.3                      scatterpie_0.1.7                         munsell_0.5.0                           
##  [10] codetools_0.2-18                         colorspace_2.0-3                         GOSemSim_2.22.0                         
##  [13] TxDb.Hsapiens.UCSC.hg38.knownGene_3.15.0 Biobase_2.56.0                           filelock_1.0.2                          
##  [16] highr_0.9                                knitr_1.39                               rstudioapi_0.13                         
##  [19] stats4_4.2.1                             DOSE_3.22.0                              MatrixGenerics_1.8.1                    
##  [22] GenomeInfoDbData_1.2.8                   polyclip_1.10-0                          seqPattern_1.28.0                       
##  [25] bit64_4.0.5                              farver_2.1.1                             downloader_0.4                          
##  [28] vctrs_0.4.1                              treeio_1.20.0                            generics_0.1.3                          
##  [31] xfun_0.31                                BiocFileCache_2.4.0                      R6_2.5.1                                
##  [34] GenomeInfoDb_1.32.2                      graphlayouts_0.8.0                       locfit_1.5-9.6                          
##  [37] bitops_1.0-7                             BRGenomics_1.8.0                         cachem_1.0.6                            
##  [40] fgsea_1.22.0                             gridGraphics_0.5-1                       DelayedArray_0.22.0                     
##  [43] assertthat_0.2.1                         promises_1.2.0.1                         BiocIO_1.6.0                            
##  [46] scales_1.2.0                             ggraph_2.0.5                             enrichplot_1.16.1                       
##  [49] gtable_0.3.0                             tidygraph_1.2.1                          rlang_1.0.4                             
##  [52] genefilter_1.78.0                        splines_4.2.1                            rtracklayer_1.56.1                      
##  [55] lazyeval_0.2.2                           impute_1.70.0                            plyranges_1.16.0                        
##  [58] BiocManager_1.30.18                      yaml_2.3.5                               reshape2_1.4.4                          
##  [61] crosstalk_1.2.0                          GenomicFeatures_1.48.3                   httpuv_1.6.5                            
##  [64] qvalue_2.28.0                            clusterProfiler_4.4.4                    tools_4.2.1                             
##  [67] ggplotify_0.1.0                          gridBase_0.4-7                           ggplot2_3.3.6                           
##  [70] ellipsis_0.3.2                           gplots_3.1.3                             jquerylib_0.1.4                         
##  [73] RColorBrewer_1.1-3                       BiocGenerics_0.42.0                      Rcpp_1.0.9                              
##  [76] plyr_1.8.7                               progress_1.2.2                           zlibbioc_1.42.0                         
##  [79] purrr_0.3.4                              RCurl_1.98-1.7                           prettyunits_1.1.1                       
##  [82] viridis_0.6.2                            S4Vectors_0.34.0                         SummarizedExperiment_1.26.1             
##  [85] ggrepel_0.9.1                            magrittr_2.0.3                           data.table_1.14.2                       
##  [88] DO.db_2.9                                matrixStats_0.62.0                       hms_1.1.1                               
##  [91] patchwork_1.1.1                          mime_0.12                                evaluate_0.15                           
##  [94] xtable_1.8-4                             XML_3.99-0.10                            IRanges_2.30.0                          
##  [97] gridExtra_2.3                            compiler_4.2.1                           biomaRt_2.52.0                          
## [100] tibble_3.1.7                             KernSmooth_2.23-20                       crayon_1.5.1                            
## [103] shadowtext_0.1.2                         htmltools_0.5.2                          ggfun_0.0.6                             
## [106] later_1.3.0                              tzdb_0.3.0                               tidyr_1.2.0                             
## [109] geneplotter_1.74.0                       aplot_0.1.6                              DBI_1.1.3                               
## [112] tweenr_1.0.2                             ChIPseeker_1.32.0                        genomation_1.28.0                       
## [115] dbplyr_2.2.1                             MASS_7.3-57                              rappdirs_0.3.3                          
## [118] boot_1.3-28                              Matrix_1.4-1                             readr_2.1.2                             
## [121] cli_3.3.0                                parallel_4.2.1                           igraph_1.3.2                            
## [124] GenomicRanges_1.48.0                     pkgconfig_2.0.3                          TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2 
## [127] GenomicAlignments_1.32.0                 plotly_4.10.0                            xml2_1.3.3                              
## [130] ggtree_3.4.0                             annotate_1.74.0                          bslib_0.3.1                             
## [133] XVector_0.36.0                           yulab.utils_0.0.5                        stringr_1.4.0                           
## [136] digest_0.6.29                            Biostrings_2.64.0                        rmarkdown_2.14                          
## [139] fastmatch_1.1-3                          tidytree_0.3.9                           restfulr_0.0.15                         
## [142] curl_4.3.2                               shiny_1.7.1                              Rsamtools_2.12.0                        
## [145] gtools_3.9.3                             rjson_0.2.21                             lifecycle_1.0.1                         
## [148] nlme_3.1-158                             jsonlite_1.8.0                           viridisLite_0.4.0                       
## [151] BSgenome_1.64.0                          fansi_1.0.3                              pillar_1.7.0                            
## [154] lattice_0.20-45                          KEGGREST_1.36.2                          fastmap_1.1.0                           
## [157] httr_1.4.3                               plotrix_3.8-2                            survival_3.3-1                          
## [160] GO.db_3.15.0                             interactiveDisplayBase_1.34.0            glue_1.6.2                              
## [163] UpSetR_1.4.0                             png_0.1-7                                BiocVersion_3.15.2                      
## [166] bit_4.0.4                                sass_0.4.1                               ggforce_0.3.3                           
## [169] stringi_1.7.8                            blob_1.2.3                               DESeq2_1.36.0                           
## [172] org.Hs.eg.db_3.15.0                      AnnotationHub_3.4.0                      caTools_1.18.2                          
## [175] memoise_2.0.1                            dplyr_1.0.9                              ape_5.6-2